CC = gcc
CFLAGS = -g -Wall -Wextra
SRC = main.c include/container.c include/tools.c include/namespace.c include/overlayfs.c
OBJ = $(SRC:.c=.o)
EXEC = mtdocker

all: $(EXEC)
	chmod u+x $(EXEC)

$(EXEC): $(OBJ)
	$(CC) $(CFLAGS) -o $@ $^

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -f $(OBJ) $(EXEC)

debug:
	sudo gdbserver :1234 ./$(EXEC) --debug-mode

run:
	sudo ./mtdocker

.PHONY: all clean
